package com.tomehay.termprojectmanage_server.mapper;
import java.util.Collection;
import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

import com.tomehay.termprojectmanage_server.pojo.Model.PersonalTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author tomehay
 * @since 2023-06-20
 */
public interface PersonalTaskMapper extends BaseMapper<PersonalTask> {

    PersonalTask getById(@Param("id") Integer id);

    List<PersonalTask> getAllByDirector(@Param("director") Integer director);

    List<PersonalTask> getAllByDirectorAndStatus(@Param("director") Integer director, @Param("status") Integer status);

    List<PersonalTask> getAllByGroupTaskId(@Param("groupTaskId") Integer groupTaskId);

    List<PersonalTask> getAllByGroupTaskIdAndStatus(@Param("groupTaskId") Integer groupTaskId, @Param("status") Integer status);

    List<PersonalTask> selectAll();

    int insertBatch(@Param("personalTaskCollection") Collection<PersonalTask> personalTaskCollection);

    int updateSelective(PersonalTask personalTask);

    int count();

    int updateDocument(@Param("document") String document);

    boolean savePersonalTask(PersonalTask personalTask);

    List<PersonalTask> getAllByGroupTaskIdAndDirector(@Param("groupTaskId") Integer groupTaskId, @Param("director") Integer director);

}
